/**
  ******************************************************************************
  * @file    myg0025_conf.h
  * @brief   myg0025  configuration file.
  *          The file is the unique include file that the application programmer
    *          is using in the C source code.it is a patch file
  ******************************************************************************
**/


/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MYG0025_CONF_H
#define __MYG0025_CONF_H

#ifdef __cplusplus
extern "C" {
#endif

/*system clock source*/
#define SYSCLK_SRC_PLL          0x1
#define SYSCLK_SRC_HSI8M        0x2
#define SYSCLK_SRC_HSI12M       0x3
#define SYSCLK_SRC_HSI48M       0x4
#define SYSCLK_SRC_HSE          0x5
#define SYSCLK_SRC_HSE_BYPASS   0x6
#define SYSCLK_SRC_EXTCLK_IO    0x7
#define SYSCLK_SRC_LSI          0x8
#define SYSCLK_SRC_LSE          0x9
/* select sysclk source here */
#define SYSCLK_SOURCE    SYSCLK_SRC_HSI48M

// #define VECT_TAB_SRAM
#define VECT_TAB_OFFSET  0x0 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */

#if(SYSCLK_SOURCE==SYSCLK_SRC_PLL)
//  #define SYSCLK_HSE8M_PLL_FREQ_24MHz         24000000     //RCC_CFGR4.PPSS = 0(选择HSE) PREDIV = 1  PLLSRC = 1  PLLMUL = 3  8M/1 * 3 = 24M
//  #define SYSCLK_HSE8M_PLL_FREQ_48MHz         48000000     //RCC_CFGR4.PPSS = 0(选择HSE) PREDIV = 1  PLLSRC = 1  PLLMUL = 6  8M/1 * 6 = 48M
#define SYSCLK_HSI_PLL_FREQ_48MHz           48000000     //HSI=8M RCC_CFGR4.PPSS = 0(选择HSE) PREDIV = 1  PLLSRC = 0(HSI/2)  PLLMUL = 12 4M/1 * 12 = 48M

#elif(SYSCLK_SOURCE == SYSCLK_SRC_HSE | SYSCLK_SOURCE == SYSCLK_SRC_HSE_BYPASS)
#define SYSCLK_FREQ_HSE                    HSE_VALUE
#elif(SYSCLK_SOURCE == SYSCLK_SRC_HSI8M)
#define SYSCLK_FREQ_HSI_8M                 8000000
#elif(SYSCLK_SOURCE == SYSCLK_SRC_HSI12M)
#define SYSCLK_FREQ_HSI_12M                12000000
#elif(SYSCLK_SOURCE == SYSCLK_SRC_HSI48M)
#define SYSCLK_FREQ_HSI_48M                48000000
#elif(SYSCLK_SOURCE == SYSCLK_SRC_EXTCLK_IO)
#define SYSCLK_FREQ_EXTCLK                 8000000
#elif(SYSCLK_SOURCE == SYSCLK_SRC_LSI)
#define SYSCLK_FREQ_LSI             LSI_VALUE
#elif(SYSCLK_SOURCE == SYSCLK_SRC_LSE)
#define SYSCLK_FREQ_LSE             LSE_VALUE
#endif

#if !defined  (HSE_VALUE)
#define HSE_VALUE    ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */

#if !defined  (LSE_VALUE)
#define LSE_VALUE    ((uint32_t)32768U) /*!< Value of the External oscillator in Hz */
#endif /* LSE_VALUE */

#if !defined  (HSI_VALUE)
#define HSI_VALUE    ((uint32_t)8000000U) /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI_VALUE */

#if !defined  (LSI_VALUE)
#define LSI_VALUE    ((uint32_t)40000U) /*!< Value of the Internal oscillator in Hz*/
#endif /* LSI_VALUE */

#if !defined  (HSI48_VALUE)
#define HSI48_VALUE    ((uint32_t)48000000U) /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI48_VALUE */

#if !defined  (HSI12_VALUE)
#define HSI12_VALUE    ((uint32_t)12000000U) /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI12_VALUE */

#if !defined  (EXTCLK_GPIOINPUT_VALUE)
#define EXTCLK_GPIOINPUT_VALUE    ((uint32_t)8000000U) /*!< Value of the Internal oscillator in Hz*/
#endif /* EXTCLK_GPIOINPUT_VALUE */

#if !defined  (HSE_STARTUP_TIMEOUT)
#define HSE_STARTUP_TIMEOUT   ((uint16_t)0xFFFF) /*!< Time out for HSE start up */
#endif

#if !defined  (HSI_STARTUP_TIMEOUT)
#define HSI_STARTUP_TIMEOUT   ((uint16_t)0xFFFF) /*!< Time out for HSI start up */
#endif


/* Includes ------------------------------------------------------------------*/
/**
  * @brief Include module's header file
  */

/* Exported macro ------------------------------------------------------------*/
#if defined MYg0025
#include "myg0025_adc.h"
#include "myg0025_dma.h"
#include "myg0025_dbgmcu.h"
#include "myg0025_exti.h"
#include "myg0025_flash.h"
#include "myg0025_gpio.h"
#include "myg0025_syscfg.h"
#include "myg0025_i2c.h"
#include "myg0025_iwdg.h"
#include "myg0025_pwr.h"
#include "myg0025_rcc.h"
#include "myg0025_spi.h"
#include "myg0025_tim.h"
#include "myg0025_divsqrt.h"
#include "myg0025_uart.h"
#include "myg0025_wwdg.h"
#include "myg0025_misc.h"
#include "myg0025_comp.h"
#include "myg0025_opamp.h"
#include "myg0025_rtc.h"
#include "myg0025_divsqrt.h"
#else
#error "Please select first the target myg0025 device used in your application (in myg0025.h file)"
#endif


#ifdef  USE_FULL_ASSERT

/**
  * @brief  The assert_param macro is used for function's parameters check.
  * @param  expr: If expr is false, it calls assert_failed function which reports
  *         the name of the source file and the source line number of the call
  *         that failed. If expr is true, it returns no value.
  * @retval None
  */
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((char *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(char *file, uint32_t line);
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */

#endif
